<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\CaseCenter;
use App\Http\Resources\CaseCenter as CaseCenterResource;
// use App\Http\Resources\CaseCenterCollection;

class CaseCenterController extends Controller
{
    public function list()
    {
     return CaseCenter::all();
    }

    public function details(Request $request)
    {
       $id = $request->input('id');
       $data = CaseCenter::where('id', $id)->get();
       // return $data;
      // return CaseCenter::collection($data);
       // return new CaseCenterResource($data);
       return CaseCenterResource::collection($data);
      // return  CaseCenterResource::collection($data);
    }
}

// "id": 2,
// "title": "抗震支架2",
// "img": "images/logo.png",
// "thumb": "images/acce0e7ce0b7093ccf0d902080c32a2d.png",
// "content": "这个也很好啊",
